# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.IdentityToolkit.V3.Model.IdentitytoolkitRelyingpartySignupNewUserRequest do
  @moduledoc """
  Request to signup new user, create anonymous user or anonymous user reauth.

  ## Attributes

  *   `captchaChallenge` (*type:* `String.t`, *default:* `nil`) - The captcha challenge.
  *   `captchaResponse` (*type:* `String.t`, *default:* `nil`) - Response to the captcha.
  *   `disabled` (*type:* `boolean()`, *default:* `nil`) - Whether to disable the user. Only can be used by service account.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The name of the user.
  *   `email` (*type:* `String.t`, *default:* `nil`) - The email of the user.
  *   `emailVerified` (*type:* `boolean()`, *default:* `nil`) - Mark the email as verified or not. Only can be used by service account.
  *   `idToken` (*type:* `String.t`, *default:* `nil`) - The GITKit token of the authenticated user.
  *   `instanceId` (*type:* `String.t`, *default:* `nil`) - Instance id token of the app.
  *   `localId` (*type:* `String.t`, *default:* `nil`) - Privileged caller can create user with specified user id.
  *   `password` (*type:* `String.t`, *default:* `nil`) - The new password of the user.
  *   `phoneNumber` (*type:* `String.t`, *default:* `nil`) - Privileged caller can create user with specified phone number.
  *   `photoUrl` (*type:* `String.t`, *default:* `nil`) - The photo url of the user.
  *   `tenantId` (*type:* `String.t`, *default:* `nil`) - For multi-tenant use cases, in order to construct sign-in URL with the correct IDP parameters, Firebear needs to know which Tenant to retrieve IDP configs from.
  *   `tenantProjectNumber` (*type:* `String.t`, *default:* `nil`) - Tenant project number to be used for idp discovery.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :captchaChallenge => String.t() | nil,
          :captchaResponse => String.t() | nil,
          :disabled => boolean() | nil,
          :displayName => String.t() | nil,
          :email => String.t() | nil,
          :emailVerified => boolean() | nil,
          :idToken => String.t() | nil,
          :instanceId => String.t() | nil,
          :localId => String.t() | nil,
          :password => String.t() | nil,
          :phoneNumber => String.t() | nil,
          :photoUrl => String.t() | nil,
          :tenantId => String.t() | nil,
          :tenantProjectNumber => String.t() | nil
        }

  field(:captchaChallenge)
  field(:captchaResponse)
  field(:disabled)
  field(:displayName)
  field(:email)
  field(:emailVerified)
  field(:idToken)
  field(:instanceId)
  field(:localId)
  field(:password)
  field(:phoneNumber)
  field(:photoUrl)
  field(:tenantId)
  field(:tenantProjectNumber)
end

defimpl Poison.Decoder,
  for: GoogleApi.IdentityToolkit.V3.Model.IdentitytoolkitRelyingpartySignupNewUserRequest do
  def decode(value, options) do
    GoogleApi.IdentityToolkit.V3.Model.IdentitytoolkitRelyingpartySignupNewUserRequest.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.IdentityToolkit.V3.Model.IdentitytoolkitRelyingpartySignupNewUserRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
